package singleton;

public class Person {
    private static final Person person1 = new Person();
    private static Person person2;

    private Person(){}

    public static Person getPerson1(){
        return person1;
    }

    public static Person getPerson2(){
        if(null == person2){
            synchronized (Person.class){
                if(null == person2){
                    person2 = new Person();
                }
            }
        }
        return person2;
    }
}
